#ifndef _thaisenGunDef_h
#define _thaisenGunDef_h


#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include "stm32f4xx_hal.h"
#include "thaisen7102Public.h"
#include "thaisenBMS.h"

#define THAISEN_GUN_NUM         2
#define THAISEN_GUN_A			0
#define THAISEN_GUN_B			1


typedef void (*thaisenChargFunT)(void);
typedef uint32_t (*thaisenChargGetFun32)(void);
typedef uint8_t (*thaisenChargGetFun8)(void);
typedef thaisenElectLockEn (*thaisenElect)(void);
typedef thaisenAuxPowerEn (*thaisenAuxPowerF)(void);
typedef thaisenRelayUEn (*thaisenRelayU)(void);

typedef uint32_t (*thaisenChargGetFun32_p)(uint8_t);

struct thaisenElectStruct
{
    thaisenAuxPowerF 			AuxPowerEnable;
    thaisenAuxPowerF 			AuxPowerClose;
	thaisenChargGetFun8 	    AuxPowerStatus;
	
	thaisenRelayU 			    DCRelayEnable;
	thaisenRelayU 			    DCRelayClose;
	thaisenChargGetFun8         DCPosRelayStatus;
	thaisenChargGetFun8         DCCatRelayStatus;
	
	thaisenChargGetFun8         CC1_Status;
	
	thaisenElect			    ElectLock;
	thaisenElect				ElectUnlock;
	
		
	thaisenChargGetFun32_p 	    ChargModuleVolt;
	thaisenChargGetFun32_p	    ChargGunVolt;
	thaisenChargGetFun32        DCPosVolt;
	thaisenChargGetFun32        DCCatVolt;
	
	thaisenChargGetFun32_p      AmmeterVolt;
	thaisenChargGetFun32_p      AmmeterCurrent;
};


typedef struct  thaisenGunStruct
{
	struct thaisenElectStruct 		    Elect;
	struct thaisenBMS_Charger_struct	*BMS;

}thaisenGunSt;

int thaisenGunInit(void);
extern thaisenGunSt* GunInfo[THAISEN_GUN_NUM];



#endif



